//
//  ZZCRequest.h
//  ZZC-Finance
//
//  Created by mac on 2017/6/9.
//  Copyright © 2017年 mac. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^RequestSuccessBlock)( NSDictionary * _Nonnull data);
typedef void(^RequestFailBlock)(NSError *_Nonnull error, NSString *_Nonnull msg, NSDictionary *_Nonnull data);

@interface ZZCRequest : NSObject

///单例方法
+ (_Nonnull instancetype) sharedNetworkTools;

///POST请求
- (void)POST:(nonnull NSString * )URLString parameters:(nullable NSDictionary* ) parameters finished:(void (^_Nonnull)(id _Nullable responseObject, NSError * _Nullable error)) finshed;
//支付充值请求
- (void)PAYPOST:(nonnull NSString * )URLString parameters:(nullable NSDictionary* ) parameters finished:(void (^_Nonnull)(id _Nullable responseObject, NSError * _Nullable error)) finshed;
///GET请求
- (void)GET:(nonnull NSString *)URLString parameters:(nullable NSDictionary* ) parameters finished:(void (^ _Nonnull)(id _Nullable responseObject, NSError * _Nullable error)) finshed;

///图片上传
- (void)uploadWithURL:(nonnull NSString *)url
               params:(nonnull NSDictionary *)parmas
         formBoundary:(nonnull UIImage *)formBoundary
              success:(nonnull RequestSuccessBlock)success
                 fail:(nonnull RequestFailBlock)fail;

+ (nonnull NSString *)getSignWithDict:(nonnull NSDictionary *)dict;
@end
